﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace class5Homework2
{
    class Program
    {
        static void Main(string[] args)
        {
            Random rnd = new Random();
            List<int> test1 = new List<int>();
            for(int i=0;i<100;i++)
            {
                int j = rnd.Next(1000);
                test1.Add(j);
            }
            var test2 = from item in test1
                        orderby item descending
                        select item;
            var test3 = test1.Sum();
            var test4 = test1.Average();

            foreach(var n in test2)
            {
                Console.WriteLine(n);
            }
            Console.WriteLine("数组的和为" + test3);
            Console.WriteLine("数组的平均值为" + test4);

        }
    }
}
